package com.emm.yixun.jobs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.emm.yixun.common.app.base.CommonResDTO;
import com.emm.yixun.common.response.Response;
import com.emm.yixun.system.service.NoticeServiceFacade;

/***
 * 客户关怀
 * 描述:
 * 	客户生日提醒,提前X天(后台设置)通知经纪人
 *  客户生日当天提醒
 *  客户纪念日提醒,提前X天(后台设置)通知经纪人
 *  客户纪念日当天提醒
 */
@Component
public class CustomerCareJob {
	 private static Logger logger = LoggerFactory.getLogger(CustomerCareJob.class);

	 @Autowired
	 private NoticeServiceFacade noticeServiceFacade;
	 
     @Scheduled(cron="${quartz.cron.createCusCareNotice}")
     public void customerCareNotice(){
    	 logger.info("客户关怀消息创建 job start..........");
    	 Response<CommonResDTO> response = noticeServiceFacade.customerCareNotice();
    	 if (response.isSuccess()) {
 			logger.info("..........客户关怀消息创建成功..........");
 		 } else {
 			logger.info("..........客户关怀消息创建失败..........");
 		 }
    	 logger.info("客户关怀消息创建 job end..........");
     }

}
